PLUGIN_REASON_PRINTING_SUPPORT: self._PluginDialog__tr('This plugin will enable printing support.'),
PLUGIN_REASON_FASTER_PRINTING: self._PluginDialog__tr('This plugin will enhance print speed.'),
PLUGIN_REASON_BETTER_PRINTING_PQ: self._PluginDialog__tr('This plugin will enhance print quality.'),
PLUGIN_REASON_PRINTING_FEATURES: self._PluginDialog__tr('This plugin will add printing features.'),
PLUGIN_REASON_RESERVED_10: None,
PLUGIN_REASON_RESERVED_20: None,
PLUGIN_REASON_SCANNING_SUPPORT: self._PluginDialog__tr('This plugin will enable scanning support.'),
PLUGIN_REASON_FASTER_SCANNING: self._PluginDialog__tr('This plugin will enhance scanning speed.'),
PLUGIN_REASON_BETTER_SCANNING_IQ: self._PluginDialog__tr('This plugin will enhance scanning image quality.'),
PLUGIN_REASON_RESERVED_200: None,
PLUGIN_REASON_RESERVED_400: None,
PLUGIN_REASON_FAXING_SUPPORT: self._PluginDialog__tr('This plugin will enable faxing support.'),
PLUGIN_REASON_FAX_FEATURES: self._PluginDialog__tr('This plugin will enhnace faxing features.'),
PLUGIN_REASON_RESERVED_20000: None,
PLUGIN_REASON_RESERVED_40000: None }
def showSourcePage(self):
reason_text = self.plugin_reason_text()
if reason_text is not None:
if self.install_mode == PLUGIN_REQUIRED:
self.TitleLabel.setText(self._PluginDialog__tr('An additional driver plug-in is required to operate this printer. You may download the plug-in directly from an HP authorized server (recommended), or, if you already have a copy of the file, you can specify a path to the file (advanced). <br><br>%1').arg(reason_text))
self.SkipRadioButton.setEnabled(False)
elif self.install_mode == PLUGIN_OPTIONAL:
self.TitleLabel.setText(self._PluginDialog__tr('An optional driver plug-in is available to enhance the operation of this printer. You may download the plug-in directly from an HP authorized server (recommended), skip this installation (not recommended), or, if you already have a copy of the file, you can specify a path to the file (advanced).<br><br>%1').arg(reason_text))
if status in (PLUGIN_INSTALL_ERROR_UNABLE_TO_RECV_KEYS, PLUGIN_INSTALL_ERROR_DIGITAL_SIG_NOT_FOUND):
endWaitCursor()
if QMessageBox.question(self, self._PluginDialog__tr('Digital signature download failed'), self._PluginDialog__tr('<b>The download of the digital signature file failed.</b><p>Without this file, it is not possible to authenticate and validate the plug-in prior to installation.</p>Do you still want to install the plug-in?'), QMessageBox.Yes | QMessageBox.No) != QMessageBox.Yes:
self.core.delete_plugin()
self.close()
return None
elif status != PLUGIN_INSTALL_ERROR_NONE:
if status == PLUGIN_INSTALL_ERROR_PLUGIN_FILE_NOT_FOUND:
desc = self._PluginDialog__tr('<b>ERROR: Plug-in file not found (server returned 404 or similar error).</b><p>Error code: %1</p>').arg(str(ret))
elif status == PLUGIN_INSTALL_ERROR_DIGITAL_SIG_BAD:
desc = self._PluginDialog__tr('<b>ERROR: Plug-in file does not match its digital signature.</b><p>File may have been corrupted or altered.</p><p>Error code: %1</p>').arg(str(ret))
elif status == PLUGIN_INSTALL_ERROR_PLUGIN_FILE_CHECKSUM_ERROR:
desc = self._PluginDialog__tr('<b>ERROR: Plug-in file does not match its checksum. File may have been corrupted or altered.')
elif status == PLUGIN_INSTALL_ERROR_NO_NETWORK:
desc = self._PluginDialog__tr('<b>ERROR: Unable to connect to network to download the plug-in.</b><p>Please check your network connection and try again.</p>')
elif status == PLUGIN_INSTALL_ERROR_DIRECTORY_ERROR:
desc = self._PluginDialog__tr('<b>ERROR: Unable to create the plug-in directory.</b><p>Please check your permissions and try again.</p>')
self.core.delete_plugin()
endWaitCursor()
FailureUI(self, desc)
self.close()
return None
if not self.core.run_plugin(GUI_MODE, self.plugin_install_callback):